var app = getApp();

Page({
    data: {
        user_info: "",
        info: "",
        msg:'',
        canIUseAvatar: true,
        canIUseNickName: true,
        id:'',
        share_num:0,
        unitId:'',
      
        flag:!1,
         userTop:[{name:'简历模版',appid:'1110252733', avatar: "http://bmobfile.twho.top/2020/04/12/86648d3d40e5c4c78044e9428f5188cf.png",},{name:'情侣头像',appid:'1109606459',path:'pages/lovers/lovers',avatar: "http://bmobfile.twho.top/2020/04/22/d9c544d840e5152a807b6ecfaa9b1888.png",},
         {name:'情侣故事',appid:'1110392490', avatar: "http://bmobfile.twho.top/2020/04/12/93dc988440d6cfc980b3b7db939b4172.png",},{name:'笑话段子',appid:'1110318870',path:'pages/recommend/jokeList', avatar: "http://bmobfile.twho.top/2020/04/12/4bfaf62d40b962ba806b30a07fa01c5c.jpeg",},{name:'驾考知识',appid:'1110319454',path:'pages/login/index',avatar: "http://bmobfile.twho.top/2020/04/12/b5f5680b40f26a3980e6e9c69a62591a.jpeg",},
{name:'你画我猜', appid:'1110354016',path:"bei_nhwc/pages/index/index", avatar: "http://bmobfile.twho.top/2020/04/12/fb245ed9405c2a33805bf7b07c44bfdb.jpeg",},],
   
        zanshang:'http://bmobfile.twho.top/2020/04/02/e46dc26e407c0014804144a3b7408293.png',
        zanshang2:'http://bmobfile.twho.top/2020/04/02/b47e8c0740a8c128807d995092a46023.jpeg'
    },
    onLoad: function(o) {},
    onReady: function() {},
    onShow: function() {
        var id=wx.getStorageSync('uid');
        var share_num=wx.getStorageSync('share_num')
         var msg=app.config.qqad
         if(msg){
            this.setData({
         
            unitId:msg
        })
         }

         this.setData({
      flag: wx.getStorageSync("flag"),
      id:id,
      share_num:share_num,
      canIUseAvatar:true
        })
     
   
    },
   
    topage(e){
        console.log(e)
        wx.navigateTo({
            url:'../../subpage/own_vote/own_vote'
        })
    },
    tips: function() {
  var a = this;
  wx.setStorageSync("flag", "1"), a.setData({
      flag: wx.getStorageSync("flag")
  });
},
      showImg(){
    var n = this;
    wx.previewImage({
        current: n.data.zanshang,
        urls: [ n.data.zanshang ]
    });
},
  showrule(e){
        wx.showModal({
            title:'邀请奖励',
            content:'邀请人综合分数会上升,邀请人数达到30人,头像加v,审核加快~',
            showCancel:false
        })
    },

      jinqun(e){
    console.log(e)
    let that=this;
    let appid =e.currentTarget.dataset.appid;
    var path=e.currentTarget.dataset.path;
    if(!path){
        path='pages/index/index'
    }
    if(!appid){return}
    wx.navigateToMiniProgram({
      appId: appid,
      path:path
    })

},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    loginUser: function() {
        wx.navigateTo({
            url: "/pages/login/index"
        });
    },
    clickJoin: function() {
        wx.navigateTo({
            url: "/pages/own_vote/own_vote?type=1"
        });
    },
    clickAdd: function() {
        wx.navigateTo({
            url: "/pages/own_vote/own_vote?type=2"
        });
    },
    clickCollect: function() {
        wx.navigateTo({
            url: "/pages/own_vote/own_vote?type=3"
        });
    },
    onShareAppMessage: function() {
        return {
            title: "快来投票吧",
            path: "/pages/index/index"
        };
    },
    showuser(e) {
        console.log("addfriend")
        console.log(e)
        //var str ="qq号:717125113",num='717125113';
        // var str = "wx号:aliaosha2", num = 'aliaosha2';
        // console.log("show")
        // wx.showModal({
        //   title: "请添加:",
        //   content: str+"",
        //   showCancel: !1,
        //   success: function (res) {
        //     console.log(res)
        //     wx.setClipboardData({
        //       data: num,
        //       success: function () {
        //         wx.showToast({
        //           title: '复制成功',
        //         })
        //       }
        //     })
        //   }
        // })
      },
  
    
});